{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
	<div class="main">
		{include admin.inc.menu}

		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<ul class="breadcrumb">
					<li>
						<i class="glyphicon glyphicon-home"></i>
						<span>当前位置：</span>
						<a href="#">{$breadcrumb[0]}</a>
						<i class="glyphicon glyphicon-chevron-right"></i>
						<a href="#">{$breadcrumb[1]}</a>
					</li>
				</ul>

				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
					{if $loginUser->hasPermission('admin/user/insert')}
					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 会员注册</a></li>
					{/if}
					<li class="active"><a href="/admin/user/signlist"><i class="glyphicon glyphicon-th-list"></i> 签约列表</a></li>
				</ul>

				<div class="inner-container">

					<!-- search form start -->
					<form class="form-inline form-search" role="form" id="search-form" autocomplete="off">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-btn">
									<select class="form-control input-sm search-options" name="select_name">
										<option value="username" {if $params[select_name]=='username'}selected{/if}>会员号</option>
										<option value="contacter" {if $params[select_name]=='contacter'}selected{/if}>联系人</option>
									</select>
								</div><!-- /btn-group -->
								<input  type="text" name="username" value="{$params[$params['select_name']]}" class="form-control input-sm">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">签约银行</div>
								<select class="form-control input-sm" name="bank_id">
									<option value="-1">全部</option>
									{loop $banks $key $val}
									<option value="{$val[id]}" {if $params[bank_id]==$key}selected{/if}>{$val[name]}</option>
									{/loop}
								</select>
							</div>
						</div>

						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">签约时间</div>
								<div class="form-inline">
									<input type="text" name="starttime" value="{$params[starttime]}" class="form-control input-sm mdate" placeholder="开始日期">
									<input type="text" name="endtime" value="{$params[endtime]}" class="form-control input-sm mdate" placeholder="结束日期">
								</div>
							</div>
						</div>

						<button type="submit" class="btn btn-success btn-sm">
							<i class="glyphicon glyphicon-search"></i> 搜索</button>
						{data_export_btn}

					</form><!-- END search form -->

					<form id="J_List_Form" autocomplete="off">
						<div class="table-responsive" style="overflow-x: visible;">
							<table class="table table-bordered table-hover" id="J_List_Table">
								<thead>
								<tr>
									<th width="20"><input type="checkbox" class="icheck check-all" /></th>
									{loop $tableHeader $val}
									<th>{$val}</th>
									{/loop}
									<th>操作</th>
								</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td class="no-records text-center">{$noRecords}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}" id="checkbox_row_{$value[id]}" /></td>
									<td><label for="checkbox_row_{$value[id]}">{$value[username]}</label></td>
									<td>{$value[contacter]}</td>
									<td>{$payways[$value[payway]][name]}</td>
									<td>{$banks[$value[sign_bank_id]][name]}</td>
									<td>{$value[sign_bank_branch]}</td>
									<td>{$value[virtual_name]}</td>
									<td>{$value[card_no]}</td>
									<td>{$value[virtual_account]}</td>
									<td>{$value[sign_time]}</td>

									<td>
										{if $loginUser->hasPermission('admin/user/changeTradePass')}
										<button class="btn btn-primary btn-xs modify-trade-pass" data-id="{$value[id]}" type="button">修改</button>
										{/if}
										{if $loginUser->hasPermission('admin/user/unsignBank')}
										<button class="btn btn-danger btn-xs unsign-bank" data-url="/admin/user/unsignBank/?id={$value[id]}" type="button">解约</button>
										{/if}
									</td>
								</tr>
								{/loop}
								</tbody>
							</table>
						</div>
					</form>

					<div class="text-right">
						{$pagemenu}
					</div>

				</div>

			</div><!-- end of inner -->
		</section>

	</div>
</div>

{include admin.inc.footer}

<script type="text/html" id="modify-tradepass-template">
	<form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 交易密码</label>
				<input type="password" name="tradepass" dtype="number" class="form-control" id="password" min-length="6" maxlength="6" placeholder="交易密码" required />
			</div>
			<p class="help-block">请输入6数字密码</p>
		</div>

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 密码确认</label>
				<input type="password" dtype="repass" for-password="password" class="form-control" min-length="6" maxlength="6" placeholder="密码确认" required />
			</div>
			<p class="help-block"></p>
		</div>

		<input type="hidden" name="id" value="{[item.id]}">
	</form>
</script>

<script>
	seajs.use('signBank', function(exports) {

		exports.init({});

	});
</script>
</body>
</html>
